package com.hongyun.tms.common.annotation;


import com.hongyun.tms.common.validator.IdCardNumberValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;

/**
 * 身份证校验
 *
 * @author lipeng
 * @date 2024-06-06
 */
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = IdCardNumberValidator.class)
public @interface IsIdCardNumber {

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    String message() default "身份证校验不成功";

}
